<!DOCTYPE html>
<html class="loginHtml">
<head>
    <meta charset="utf-8">
    <title>淘电网后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="http://cs.taodiandating.cn/from/view/common/favicon.ico">
    <link rel="stylesheet" href="${base}/static/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${base}/static/css/login.css?t=${.now?long}" media="all" />
    <style>
        #bg-body{
            width: 100%;
            height: 100%;
            position: fixed;
            left: 0;
            right: 0;
            background-image: url("${base}/static/images/back.jpg");
            background-size:cover;
            background-position:center;
            background-repeat:no-repeat;
            transition:all .5s;
        }
        .login{
            background-color: rgba(13,66,128,0.5);
            border: 1px solid rgba(26,139,255 ,0.5);
            padding: 50px !important;
            margin:auto;
            left:0;
            right:0;
            bottom:0;
            top:0
        }
        .layui-form-checkbox[lay-skin=primary] span{
            color: #ffffff !important;
        }

    </style>
</head>
<body>
<div id="bg-body">
    <div id="large-header" class="large-header">
        <canvas id="demo-canvas" width="1101" height="977"></canvas>
    </div>
</div>
<div class="login">
    <h1>山西云电云联</h1>
    <form class="layui-form" action="${base}/login/main" method="post">
        <div class="layui-form-item">
            <input class="layui-input" name="username" value="" placeholder="请输入用户名" lay-verify="required" type="text" autocomplete="off">
        </div>
        <div class="layui-form-item">
            <input class="layui-input" name="password" value="" placeholder="请输入密码" lay-verify="required" type="password" autocomplete="off">
        </div>
        <div class="layui-form-item form_code">
            <input class="layui-input" name="code" placeholder="验证码" lay-verify="required" type="text" autocomplete="off">
            <div class="code"><img src="${base}/genCaptcha" width="116" height="36" id="mycode"></div>
        </div>
        <div class="layui-form-item">
            <input type="checkbox" name="rememberMe" value="true" lay-skin="primary" checked title="记住帐号?">
        </div>
        <div class="layui-form-item">
            <button class="layui-btn login_btn" lay-submit="" lay-filter="login">登录</button>
        </div>
    </form>
</div>
<script src="${base}/static/js/TweenLite.min.js"></script>
<script src="${base}/static/js/EasePack.min.js"></script>
<script src="${base}/static/js/canvas.min.js"></script>
<script type="text/javascript" src="${base}/static/layui/layui.js"></script>
<script type="text/javascript" src="${base}/static/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/static/js/jquery.bcat.bgswitcher.js"></script>
<script>
    layui.use(['layer', 'form'], function() {
        var layer = layui.layer,
                $ = layui.jquery,
                form = layui.form;

        $(document).ready(function() {
        console.info(window.parent.document)
        	if (self != top) {
        		window.parent.document.location.reload();
        	}
            var srcBgArray = ["http://sxlc-ydyl.oss-cn-beijing.aliyuncs.com/YDYL/Banner/af9c9e2711d74d059be9772432ef1885.jpg",
                "http://sxlc-ydyl.oss-cn-beijing.aliyuncs.com/YDYL/Banner/b28308f457854d9ca65a5c8b642a694d.jpg"];

            $('#bg-body').bcatBGSwitcher({
                timeout:5000,
                urls: srcBgArray,
                alt: 'Full screen background image'
            });
        });

        $("#mycode").on('click',function(){
            var t = Math.random();
            $("#mycode")[0].src="${base}/genCaptcha?t= "+t;
        });

        form.on('submit(login)', function(data) {
            var loadIndex = layer.load(2, {
                shade: [0.3, '#333']
            });
            if($('form').find('input[type="checkbox"]')[0].checked){
                data.field.rememberMe = true;
            }else{
                data.field.rememberMe = false;
            }
            $.post(data.form.action, data.field, function(res) {
                layer.close(loadIndex);
                if(res.success){
                    location.href="${base}/"+res.data.url;
                }else{
                    layer.msg(res.message);
                    $("#mycode").click();
                }
            });
            return false;
        });
    });
</script>
</body>

</html>
